package com.sansui.List;


public class LinkList implements Collection{
	
	private Node headNode;
	private Node tailNode;
	
	int size = 0;
	
	public void add(Object obj){
		Node node = new Node();
		node.setData(obj);
		if(headNode == null){
			headNode = node ;
			tailNode = node;
		}
		tailNode.setNext(node);
		tailNode = node;
		size++;
	}
	
	public int size(){
		return size;
	}
	
	public Object get(int position){
		Node node = headNode ;
		for(int i = 0 ; i < position ; i++){
			node = node.getNext();
		}
		
		return node.getData();
	}
	
	public Interator interator(){
		return null;
	}
}
